import request from '@/utils/request'

export const getTaskPageData = (params: any) =>
  <any>request({
    url: '/jobs',
    method: 'get',
    params
  })
export const getTaskInfoData = (id: number) =>
  <any>request({
    url: `/jobs/${id}`,
    method: 'get'
  })

export const postSyncData = (id: number) =>
  <any>request({
    url: `/jobs/sync/${id}`,
    method: 'post'
  })

export const postTaskInfoData = (data:object) =>
  <any>request({
    url: `/jobs`,
    method: 'POST',
    data
  })

export const putTaskInfoData = (id:number, data:object) =>
  <any>request({
    url: `/jobs/${id}`,
    method: 'PUT',
    data
  })

export const deleteTaskData = (id:Number) =>
<any>request({
  url: `jobs/${id}`,
  method: 'DELETE'
})
